#ifndef __win_widget_root_h__
#define __win_widget_root_h__

#include "core/widget.h"
#include "core/container.h"
#include "core/style.h"
#include "win/builder.h"

namespace win 
{
    class WidgetRoot
    {
    public:
        WidgetRoot() 
            : body_(0)
            , active_(0) {}

        ~WidgetRoot()
        {
            if (body_)
                body_->Drop();
        }

        BOOL ParseXml(const wchar_t* file);

        Builder* GetBuilder();

    private:
        core::StContainer* body_;
        core::StWidget*    active_;
        core::StStyleCache style_cache_;

    private:
        DISABLE_COPY_AND_ASSIGN(WidgetRoot)
    };
}

#endif